/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.f1x.api.message.fields;

// Generated by org.f1x.tools.DictionaryGenerator from QuickFIX dictionary
public enum AllocRejCode implements org.f1x.api.message.types.IntEnum {
	UNKNOWN_ACCOUNT(0),
	INCORRECT_QUANTITY(1),
	INCORRECT_AVERAGE_PRICE(2),
	UNKNOWN_EXECUTING_BROKER_MNEMONIC(3),
	COMMISSION_DIFFERENCE(4),
	UNKNOWN_ORDERID(5),
	UNKNOWN_LISTID(6),
	OTHER(7),
	INCORRECT_ALLOCATED_QUANTITY(8),
	CALCULATION_DIFFERENCE(9),
	UNKNOWN_OR_STALE_EXEC_ID(10),
	MISMATCHED_DATA_VALUE(11),
	UNKNOWN_CLORDID(12),
	WAREHOUSE_REQUEST_REJECTED(13);

	private final int code;

	AllocRejCode (int code) {
		this.code  = code;
	}

	public int getCode() { return code; }

	public static AllocRejCode parse(String s) {
		switch(s) {
			case "0" : return UNKNOWN_ACCOUNT;
			case "1" : return INCORRECT_QUANTITY;
			case "2" : return INCORRECT_AVERAGE_PRICE;
			case "3" : return UNKNOWN_EXECUTING_BROKER_MNEMONIC;
			case "4" : return COMMISSION_DIFFERENCE;
			case "5" : return UNKNOWN_ORDERID;
			case "6" : return UNKNOWN_LISTID;
			case "7" : return OTHER;
			case "8" : return INCORRECT_ALLOCATED_QUANTITY;
			case "9" : return CALCULATION_DIFFERENCE;
			case "10" : return UNKNOWN_OR_STALE_EXEC_ID;
			case "11" : return MISMATCHED_DATA_VALUE;
			case "12" : return UNKNOWN_CLORDID;
			case "13" : return WAREHOUSE_REQUEST_REJECTED;
		}
		return null;
	}

}